<!DOCTYPE html>
<?php
include 'proses/konek.php';
session_start();
if(!isset($_SESSION['admin']))
   {   
  ?><script language="javascript">alert('anda blm login');
document.location='index.html'</script><?php 
}
else
{
$username = $_SESSION['admin'];
}
?>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>USER</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="css/plugins/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="css/plugins/dataTables.bootstrap.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="dashboard.php">Admin</a>
            </div>
            <!-- /.navbar-top-links -->

            <?php
            include 'proses/menustatic.php';
            $menustatic = new menustatic;
            $menustatic->menus();
             ?>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">User Manager</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            File Siswa
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Nama Depan</th>
                                            <th>Nama Belakang</th>
                                            <th>Kelas</th>
                                            <th>Email</th>
                                            
                                            <th>Edit</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    $no=1;
                                    $query=mysql_query("select * from siswa");
                                    while($file=mysql_fetch_assoc($query))
                                    {
                                        echo "<tr class='odd gradeX'>
                                            <td>".$no."</td>
                                            <td>".$file['first_nm']."</td>
                                            <td>".$file['last_nm']."</td>
                                            <td>".$file['kls']."</td>
                                            <td>".$file['email_sis']."</td>

                                            <td><a class='btn btn-success' href='usereditor.php?target=siswa&&id=".$file['id_siswa']."'>UPDATE</a><strong>/</strong><a class='btn btn-danger' href='proses/delete.php?user=siswa&&id=".$file['id_siswa']."'>DELETE</a></td>
                                        </tr>";
                                        $no++;
                                    }
                                    ?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <br>
                    <br>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            File Guru
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example2">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Nama Depan</th>
                                            <th>Nama Belakang</th>
                                            <th>Tanggal Lahir</th>
                                            <th>Matapelajaran</th>
                                            <th>Email</th>
                                            <th>Username</th>
                                            <th>Edit</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    $no=1;
                                    $query=mysql_query("select * from guru");
                                    while($file=mysql_fetch_assoc($query))
                                    {
                                        echo "<tr class='odd gradeX'>
                                            <td>".$no."</td>
                                            <td>".$file['first_name']."</td>
                                            <td>".$file['last_name']."</td>
                                            <td>".$file['ttl']."</td>
                                            <td>".$file['mapel']."</td>
                                            <td>".$file['email']."</td>
                                            <td>".$file['username']."</td>
                                            <td><a class='btn btn-success' href='usereditor.php?target=guru&&id=".$file['id_guru']."'>UPDATE</a><strong>/</strong><a class='btn btn-danger' href='proses/delete.php?user=guru&&id=".$file['id_guru']."&&directory=".$file['username']."'>DELETE</a></td>
                                        </tr>";
                                        $no++;
                                    }
                                    ?>
                                    </tbody>
                                </table>

                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    
                    <!-- /.panel -->
                </div>  
                <!-- /.col-lg-12 -->
            </div>	
                <!-- /.col-lg-12 -->
            </div>

        </div>
        <!-- /#page-wrapper -->
    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="js/plugins/metisMenu/metisMenu.min.js"></script>

    <!-- DataTables JavaScript -->
    <script src="js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="js/sb-admin-2.js"></script>

    <!-- Page-Level Demo Scripts - Tables - Use for reference -->
    <script>
    $(document).ready(function() {
        $('#dataTables-example').dataTable();
        $('#dataTables-example2').dataTable();
				
    });
    </script>

</body>

</html>
